const express =require("express")
const path= require("path")
let users=require("./users.json")
let app = express()

//设置路径
app.set('views',path.join(__dirname,'./views'));

app.set("view engine",'esj');
app.get("/index",(req,res)=>{
    // res.send("hello");
    res.sendFile(path.join(__dirname,"./views/index.html"));
});


app.get('/users',(req,res)=>{
    
    res.render("showUsers.ejs",{users});
})

app.listen(8889)